package com.srt.controller;


import com.srt.model.Category;
import com.srt.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author rd06
 * @since 2021-05-11
 */
@RestController
@RequestMapping("/category")
public class CategoryController {

    @Autowired
    CategoryService categoryService;

    /**
     * 获取所有的类别
     *
     * @return
     */
    @GetMapping("/list")
    public List<Category> list() {
        return categoryService.list();
    }

}

